Skip to content

Add a way to get the connection addresses#487

Merged
kruton merged 1 commit intoconnectbot:mainfrom
kruton:socket-from-connection
Apr 23, 2026
Merged

Add a way to get the connection addresses#487
kruton merged 1 commit intoconnectbot:mainfrom
kruton:socket-from-connection

Conversation

@kruton
Copy link
Copy Markdown
Member

@kruton kruton commented Apr 23, 2026

The local and remote socket address is used for tracking connectivity in ConnectBot.

Copilot AI review requested due to automatic review settings April 23, 2026 01:18
@kruton kruton force-pushed the socket-from-connection branch from f75a7f4 to d7a41c7 Compare April 23, 2026 01:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds access to the underlying connection’s local and remote socket addresses (for ConnectBot connectivity tracking) and wires those addresses into ConnectionInfo, with accompanying unit/integration tests.

Changes:

  • Add Connection#getLocalSocketAddress() / getRemoteSocketAddress() APIs backed by TransportManager.
  • Store local/remote socket addresses on ConnectionInfo during key exchange completion.
  • Add unit and OpenSSH integration tests covering the new behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/com/trilead/ssh2/Connection.java Exposes local/remote socket addresses via new public methods.
src/main/java/com/trilead/ssh2/transport/TransportManager.java Provides socket address accessors from the underlying Socket.
src/main/java/com/trilead/ssh2/transport/KexManager.java Populates socket address fields into ConnectionInfo on NEWKEYS.
src/main/java/com/trilead/ssh2/ConnectionInfo.java Adds localSocketAddress and remoteSocketAddress fields.
src/test/java/com/trilead/ssh2/ConnectionTest.java Adds unit tests for “not connected” error behavior.
src/test/java/com/trilead/ssh2/OpenSSHCompatibilityTest.java Adds integration test validating socket address access and propagation to ConnectionInfo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/com/trilead/ssh2/transport/TransportManager.java
Comment thread src/test/java/com/trilead/ssh2/OpenSSHCompatibilityTest.java Outdated
@kruton kruton force-pushed the socket-from-connection branch from d7a41c7 to a9445cf Compare April 23, 2026 01:49
The local and remote socket address is used for tracking connectivity in ConnectBot.
@kruton kruton force-pushed the socket-from-connection branch from a9445cf to 526e3a7 Compare April 23, 2026 01:50
@sonarqubecloud
Copy link
Copy Markdown

@kruton kruton merged commit 4a8dc75 into connectbot:main Apr 23, 2026
6 checks passed
@kruton kruton deleted the socket-from-connection branch April 23, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants